package com.zm.damai.damaiindex.web.feign.impl;

import com.zm.damai.damaiindex.web.feign.UserAction;
import com.zm.damaicommon.Result;
import org.springframework.stereotype.Component;

@Component
public class UserActionImpl implements UserAction {
    @Override
    public String way() {
        return "user: 服务降级";
    }

    @Override
    public String hello(String name) {
        return "服务降级: hello:" +name;
    }

    @Override
    public int add(int x, int y) {
        return x+y+1000;
    }

    @Override
    public int sub(int x, int y) {
        return x-y-1000;
    }

    @Override
    public Result result(Result result) {
        result.setCode(9999);
        result.setMsg("服务降级:"+result.getMsg());
        return result;
    }
}
